package com.heeexy.example.service;

import com.alibaba.fastjson.JSONObject;
import com.heeexy.example.dao.CategoryDao;
import com.heeexy.example.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Service
public class CategoryService {

    @Autowired
    CategoryDao categoryDao;
    /**
     * 目录列表
     */
    public JSONObject getCategoryList(JSONObject jsonObject){
        CommonUtil.fillPageParam(jsonObject);
        int count = categoryDao.countCategory();
        List<JSONObject> list = categoryDao.listCategory(jsonObject);
        return CommonUtil.successPage(jsonObject, list, count);

    }
}
